import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

import CLIPSJNI.Environment;

/* Implement FindFact which returns just a FactAddressValue or null */
/* TBD Add size method to PrimitiveValue */

class TestVocacionalDemo extends JFrame {

    /**
     * 
     */
    private static final long serialVersionUID = -2230443076639866447L;
    JLabel dLabel;
    JButton nextButton;
    JButton prevButton;
	JButton evalButton;
    JPanel choicesPanel;
    ButtonGroup choicesButtons;
   
	PrintWriter writer;
    Environment clips;

    TestVocacionalDemo() {
    	
    	PrintWriter writer;
		try {
			writer = new PrintWriter("data.txt");
	    	writer.print("");
	    	writer.close();
		} catch (FileNotFoundException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
        
		clips = new Environment();

        /* ================================ */
        /* Create a new JFrame container. */
        /* ================================ */

        final JFrame jfrm = new JFrame("TestVocacionalDemo");

        /* ============================= */
        /* Specify FlowLayout manager. */
        /* ============================= */

        jfrm.getContentPane().setLayout(new GridLayout(3, 1));

        /* ================================= */
        /* Give the frame an initial size. */
        /* ================================= */

        jfrm.setSize(750, 300);
        jfrm.setLocation(200, 100);

        /* ============================================================= */
        /* Terminate the program when the user closes the application. */
        /* ============================================================= */

        jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        /* =========================== */
        /* Create the display panel. */
        /* =========================== */

		
		
        JPanel displayPanel = new JPanel();
        JLabel displayLabel = new JLabel();
        displayPanel.add(displayLabel);

        /* =========================== */
        /* Create the choices panel. */
        /* =========================== */

        choicesPanel = new JPanel();
        choicesButtons = new ButtonGroup();
		
		
        
         dLabel= new JLabel("Bienvenido a tu futuro profesional");
		 choicesPanel.add(dLabel);
		 
        /* =========================== */
        /* Create the buttons panel. */
        /* =========================== */

         


        JPanel buttonPanel = new JPanel();


        nextButton = new JButton("Next");
        nextButton.setActionCommand("Next");
        buttonPanel.add(nextButton);
        nextButton.addActionListener(new ActionListener() {
            
            @Override
            public void actionPerformed(ActionEvent e) {
					PersonalidadPanel persopanel = new PersonalidadPanel();
					persopanel.setVisible(true);
					jfrm.setVisible(false);
					

            }
        });
		    
    

        /* ===================================== */
        /* Add the panels to the content pane. */
        /* ===================================== */

        jfrm.getContentPane().add(displayPanel);
        jfrm.getContentPane().add(choicesPanel);
        jfrm.getContentPane().add(buttonPanel);

        /* ======================== */
        /* Load the auto program. */
        /* ======================== */

               
//        clips.load("DiapositivasV2.clp");
//
//        clips.reset();
//        clips.run();
        
        //Clips.getInstancia().getClips().load("DiapositivasV2.clp");

        /* ==================== */
        /* Display the frame. */
        /* ==================== */

        jfrm.setVisible(true);
        displayLabel.setText("Run clips file");
        /* ================================== */
        /* Get the current state of the UI. */
        /* ================================== */

        
    }

  

    public static void main(String args[]) {
        // Create the frame on the event dispatching thread.
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                new TestVocacionalDemo();
            }
        });
    }



}